<template>
	<view class="main">
		<view class="content">
			<view class="item" @click="ToPage('/pages/PassWord/password')">
				<text>修改交易密码</text>
				<u-icon name="arrow-right" color="#BBBBBB"></u-icon>
			</view>
			<view class="quit">
				<u-button @click="quit">退出登录</u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type:1,//是否为设置密码
				
			}
		},
		onLoad(e) {
			
		},
		onShow() {
			try {
			    const userInfo = uni.getStorageSync('userInfo');
			    if (userInfo) {
			        console.log('当前数据------',userInfo.safety_code);
					if(userInfo.safety_code){
						this.type = 2
					}
			    }
			} catch (e) {
			    // error
			}
		},
		methods: {
			//退出登录
			quit(){
				uni.removeStorage({
				    key: 'token',
				    success: function (res) {
				        console.log('success');
						uni.reLaunch({
						    url: '/pages/Login/index'
						});
						
				    },fail:(err)=>{
				    	console.log('退出失败------',err)
				    }
				});
			},
			ToPage(url){
				uni.navigateTo({
				    url: url+'?type='+this.type
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.main{
		.content{
			.item{
				padding: 38rpx 34rpx;
				border-bottom: 2rpx solid #F5F5F5;
				display: flex;
				justify-content: space-between;
				align-items: center;
				text{
					font-size: 28rpx;
					font-family: $G-fm;
					font-weight: 400;
					color: #131415;
					line-height: 40rpx;
				}
			}
			.quit{
				width: 100%;
				position: fixed;
				left: 0;
				bottom: 150rpx;
				/deep/button{
					width: 686rpx;
					height: 80rpx;
					background: linear-gradient(135deg, #2F73FD 0%, #2F73FD 100%);
					box-shadow: 0px 4rpx 8rpx 0px #A6C4FF;
					border-radius: 45rpx;
					font-size: 32rpx;
					font-family: $G-fm;
					font-weight: 600;
					color: #FFFFFF;
					line-height: 44rpx;
				}
				/deep/.u-hairline-border:after{
					border: 0;
				}
			}
		}
	}
</style>
